<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="Listener,gugga.eventHelpers.Listener,Listening,TargetEventDescriptor,start,stop,create,createDataForwardingListener,createSingleTimeListener,createSingleTimeDataForwardingListener" name="keywords">
<title>gugga.eventHelpers.Listener</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'Listener - API Documentation';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?gugga/eventHelpers/Listener.html&amp;gugga/eventHelpers/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;Listener</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class Listener"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">gugga.eventHelpers</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Listener</td>
</tr>
</table>
<p></p>
  <code>Listener</code> provide us with a mechanism of binding an event 
  to a consumer function. Optionally we could pass additional data to that 
  function if the <code>Listener</code> is created as merging. This gives us 
  the power to pass data, that we've decided not to keep in the event object. 
  <p>
  In Actionscript 2 GuggaFF this additional data is actually merged into the 
  event object, but that approach is not working in Actionscript 3. In Actionscript 3
  dynamic addition of new properties is possible only for objects marked as 
  <i>dynamic</i> and that's the reason to pass this data as an additional argument to 
  the consumer function.
  <p>
  The correct use of the <code>Listener</code> is through its static methods:
  <ul>
   <li>create()</li>
   <li>createMergingListener()</li>
   <li>createSingleTimeListener()</li>
   <li>createSingleTimeMergingListener()</li>
  </ul>
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#Listening">Listening</a> : Boolean<div class="summaryTableDescription">[read-only]</div>
</td><td class="summaryTableOwnerCol">Listener</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#TargetEventDescriptor">TargetEventDescriptor</a> : <a href="../eventHelpers/EventDescriptor.html">EventDescriptor</a>
<div class="summaryTableDescription">[read-only]</div>
</td><td class="summaryTableOwnerCol">Listener</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#Listener()">Listener</a>(aTargetEventDescriptor:<a href="EventDescriptor.html">EventDescriptor</a>, aConsumerFunction:Function, aForwardOnce:Boolean = false, aDataObject:*, aIsMerging:Boolean = false, aUseWeakReference:Boolean = false)</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">Listener</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#create()">create</a>(aTargetEventDescriptor:<a href="EventDescriptor.html">EventDescriptor</a>, aConsumerFunction:Function, aDataObject:Object, aForwardOnce:Boolean, aUseWeakReference:Boolean = false):<a href="../eventHelpers/Listener.html">Listener</a>
</div>
<div class="summaryTableDescription">[static]</div>
</td><td class="summaryTableOwnerCol">Listener</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#createDataForwardingListener()">createDataForwardingListener</a>(aTargetEventDescriptor:<a href="EventDescriptor.html">EventDescriptor</a>, aConsumerFunction:Function, aDataObject:Object, aUseWeakReference:Boolean = false):<a href="../eventHelpers/Listener.html">Listener</a>
</div>
<div class="summaryTableDescription">[static]</div>
</td><td class="summaryTableOwnerCol">Listener</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#createSingleTimeDataForwardingListener()">createSingleTimeDataForwardingListener</a>(aTargetEventDescriptor:<a href="EventDescriptor.html">EventDescriptor</a>, aConsumerFunction:Function, aDataObject:Object, aUseWeakReference:Boolean = false):<a href="../eventHelpers/Listener.html">Listener</a>
</div>
<div class="summaryTableDescription">[static]</div>
</td><td class="summaryTableOwnerCol">Listener</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#createSingleTimeListener()">createSingleTimeListener</a>(aTargetEventDescriptor:<a href="EventDescriptor.html">EventDescriptor</a>, aConsumerDelegate:Function, aUseWeakReference:Boolean = false):<a href="../eventHelpers/Listener.html">Listener</a>
</div>
<div class="summaryTableDescription">[static]</div>
</td><td class="summaryTableOwnerCol">Listener</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#start()">start</a>():void</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">Listener</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#stop()">stop</a>():void</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">Listener</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="Listening"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Listening</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>Listening:Boolean</code>&nbsp;&nbsp;[read-only]<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get Listening():Boolean</code>
<br>
</div>
<a name="TargetEventDescriptor"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">TargetEventDescriptor</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>TargetEventDescriptor:<a href="../eventHelpers/EventDescriptor.html">EventDescriptor</a></code>&nbsp;&nbsp;[read-only]<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get TargetEventDescriptor():<a href="../eventHelpers/EventDescriptor.html">EventDescriptor</a></code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="Listener()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Listener</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function Listener(aTargetEventDescriptor:<a href="EventDescriptor.html">EventDescriptor</a>, aConsumerFunction:Function, aForwardOnce:Boolean = false, aDataObject:*, aIsMerging:Boolean = false, aUseWeakReference:Boolean = false)</code><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">aTargetEventDescriptor</span>:<a href="EventDescriptor.html">EventDescriptor</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aConsumerFunction</span>:Function</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aForwardOnce</span>:Boolean</code> (default = <code>false</code>)<code></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aDataObject</span>:*</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aIsMerging</span>:Boolean</code> (default = <code>false</code>)<code></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aUseWeakReference</span>:Boolean</code> (default = <code>false</code>)<code></code></td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="create()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">create</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function create(aTargetEventDescriptor:<a href="EventDescriptor.html">EventDescriptor</a>, aConsumerFunction:Function, aDataObject:Object, aForwardOnce:Boolean, aUseWeakReference:Boolean = false):<a href="../eventHelpers/Listener.html">Listener</a></code><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">aTargetEventDescriptor</span>:<a href="EventDescriptor.html">EventDescriptor</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aConsumerFunction</span>:Function</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aDataObject</span>:Object</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aForwardOnce</span>:Boolean</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aUseWeakReference</span>:Boolean</code> (default = <code>false</code>)<code></code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../eventHelpers/Listener.html">Listener</a></code></td>
</tr>
</table>
</div>
<a name="createDataForwardingListener()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">createDataForwardingListener</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function createDataForwardingListener(aTargetEventDescriptor:<a href="EventDescriptor.html">EventDescriptor</a>, aConsumerFunction:Function, aDataObject:Object, aUseWeakReference:Boolean = false):<a href="../eventHelpers/Listener.html">Listener</a></code><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">aTargetEventDescriptor</span>:<a href="EventDescriptor.html">EventDescriptor</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aConsumerFunction</span>:Function</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aDataObject</span>:Object</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aUseWeakReference</span>:Boolean</code> (default = <code>false</code>)<code></code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../eventHelpers/Listener.html">Listener</a></code></td>
</tr>
</table>
</div>
<a name="createSingleTimeDataForwardingListener()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">createSingleTimeDataForwardingListener</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function createSingleTimeDataForwardingListener(aTargetEventDescriptor:<a href="EventDescriptor.html">EventDescriptor</a>, aConsumerFunction:Function, aDataObject:Object, aUseWeakReference:Boolean = false):<a href="../eventHelpers/Listener.html">Listener</a></code><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">aTargetEventDescriptor</span>:<a href="EventDescriptor.html">EventDescriptor</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aConsumerFunction</span>:Function</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aDataObject</span>:Object</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aUseWeakReference</span>:Boolean</code> (default = <code>false</code>)<code></code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../eventHelpers/Listener.html">Listener</a></code></td>
</tr>
</table>
</div>
<a name="createSingleTimeListener()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">createSingleTimeListener</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function createSingleTimeListener(aTargetEventDescriptor:<a href="EventDescriptor.html">EventDescriptor</a>, aConsumerDelegate:Function, aUseWeakReference:Boolean = false):<a href="../eventHelpers/Listener.html">Listener</a></code><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">aTargetEventDescriptor</span>:<a href="EventDescriptor.html">EventDescriptor</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aConsumerDelegate</span>:Function</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">aUseWeakReference</span>:Boolean</code> (default = <code>false</code>)<code></code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../eventHelpers/Listener.html">Listener</a></code></td>
</tr>
</table>
</div>
<a name="start()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">start</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function start():void</code>
</div>
<a name="stop()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">stop</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function stop():void</code>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
